#include "CLog.h"

CLog* CLog::singleton = 0;

CLog::CLog()
{
    c_database = new CDataBase;
}

CLog::~CLog()
{
    delete c_database;
}

CLog* CLog::getInstance()
{
    if(!singleton)
    {
        singleton = new CLog;
    }
    return singleton;
}

void CLog::add_chat(QString username, QString content)
{
    username.replace("'", "047");
    content.replace("'", "047");
    c_database->add_log_chat(username, content);
}

void CLog::add_connection(QString _username, QString _password, int _succeed)
{
    _username.replace("'", "047");
    _password.replace("'", "047");
    c_database->add_log_connection(_username, _password, _succeed);
}
